#include <cstdio>
#include <cstring>

const int N = 1e5 + 5;

int t, n, e_cnt, heads[N], deg[N];
bool ans;

struct Edge {
  int v, nxt;
} e[N << 1];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
  ++deg[v];
}

bool dfs(int u, int fa) {
  int cnt = 0;
  if (ans) return true;
  for (int i = heads[u], v; i; i = e[i].nxt) {
    if ((v = e[i].v) != fa) { cnt += dfs(v, u); }
  }
  if (cnt > 1) return ans = true;
  else if (cnt == 1)
    return false;
  return true;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen64("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen64("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("tree.in", "r", stdin);
  freopen("tree.out", "w", stdout);
#endif
#endif

  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    memset(heads, 0, sizeof(heads));
    e_cnt = 0, ans = false;
    for (int i = 1, a, b; i < n; ++i) {
      scanf("%d%d", &a, &b);
      add(a, b), add(b, a);
    }
    puts(dfs(1, 1) || ans ? "Illyasviel" : "Miyu");
  }
  return 0;
}